﻿using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.UserCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.UserHanders
{
    /// <summary>
    /// 所在省
    /// </summary>
    public class ProvinceShowCommandHandler : IRequestHandler<ProvinceShowCommand, List<Province>>
    {
        private readonly IProvinceService _provinceService;

        public ProvinceShowCommandHandler(IProvinceService provinceService)
        {
            _provinceService = provinceService;
        }

        public async Task<List<Province>> Handle(ProvinceShowCommand request, CancellationToken cancellationToken)
        {
            return await _provinceService.GetProvincesList();
        }
    }
}
